﻿using System;
using UnityEngine;

namespace ParticlePlayground
{
	// Token: 0x02000160 RID: 352
	[Serializable]
	public class PlaygroundBrushC
	{
		// Token: 0x06000829 RID: 2089 RVA: 0x00030028 File Offset: 0x0002E228
		public virtual void SetTexture(Texture2D newTexture)
		{
			this.texture = newTexture;
			this.Construct();
		}

		// Token: 0x0600082A RID: 2090 RVA: 0x00030038 File Offset: 0x0002E238
		public virtual void Construct()
		{
			this.color = PlaygroundC.GetPixels(this.texture);
			if (this.color != null)
			{
				this.colorLength = this.color.Length;
			}
		}

		// Token: 0x0600082B RID: 2091 RVA: 0x00030064 File Offset: 0x0002E264
		public virtual Color32 GetColor(int index)
		{
			index %= this.colorLength;
			return this.color[index];
		}

		// Token: 0x0600082C RID: 2092 RVA: 0x00030084 File Offset: 0x0002E284
		public virtual void SetColor(Color32 c, int index)
		{
			this.color[index] = c;
		}

		// Token: 0x0600082D RID: 2093 RVA: 0x00030098 File Offset: 0x0002E298
		public virtual PlaygroundBrushC Clone()
		{
			PlaygroundBrushC playgroundBrushC = new PlaygroundBrushC();
			playgroundBrushC.texture = this.texture;
			playgroundBrushC.scale = this.scale;
			playgroundBrushC.detail = this.detail;
			playgroundBrushC.distance = this.distance;
			if (playgroundBrushC.color != null)
			{
				playgroundBrushC.color = (this.color.Clone() as Color32[]);
			}
			playgroundBrushC.colorLength = this.colorLength;
			return playgroundBrushC;
		}

		// Token: 0x04000817 RID: 2071
		public Texture2D texture;

		// Token: 0x04000818 RID: 2072
		public float scale = 1f;

		// Token: 0x04000819 RID: 2073
		public BRUSHDETAILC detail = BRUSHDETAILC.High;

		// Token: 0x0400081A RID: 2074
		public float distance = 10000f;

		// Token: 0x0400081B RID: 2075
		[HideInInspector]
		public Color32[] color;

		// Token: 0x0400081C RID: 2076
		[HideInInspector]
		public int colorLength;
	}
}
